﻿using UnityEngine;
using UnityEngine.UI;

[DisallowMultipleComponent]
[RequireComponent(typeof(Text))]
public class LanguageText : MonoBehaviour
{
    private Text language;
    [SerializeField]
    private int languageId;

    private void Awake()
    {
        UpdateText();
    }

    public void UpdateText()
    {
        language = GetComponent<Text>();
        language.text = ParseUtility.GetSingleton().GetTextById(languageId);
    }
}